﻿using System;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using HiauPdm.Bll;
using HiauPdm.Web;

namespace HiauPdm.Web
{
    public partial class ChangePwd : PageBase
    {
        protected override bool IsAccess()
        {
            return true;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BtnSave.OnClientClick = "this.disabled=true;" + Page.ClientScript.GetPostBackEventReference(BtnSave, null) + ";return false;";
                TextPwdOld.Focus();
            }
        }

        protected void BtnSave_Click(object sender, EventArgs e)
        {
            if (ShowErr(BMain.ChangePwd((int)Session["UserId"], TextPwdOld.Text, TextPwdNew.Text, TextPwdNew2.Text)))
            {
                TextPwdOld.Focus();
            }
            else
            {
                MsgBox("密码修改成功，请牢记您的新密码！", true);
            }
        }
    }
}